package com.nbsaas.boot.monitor;

import com.lmax.disruptor.EventHandler;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ApiLogEventHandler implements EventHandler<ApiLogEvent> {

    @Override
    public void onEvent(ApiLogEvent event, long sequence, boolean endOfBatch) {
        // 示例：打印日志，也可以写入数据库或Prometheus
        log.info("[接口调用] 租户={} URI={} 方法={} 状态={} 耗时={}ms",
                event.getTenantId(), event.getUri(), event.getMethod(),
                event.getStatus(), event.getDuration());
    }
}